package com.net.tool;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;

import com.net.tool.DownLoadTask;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public abstract class DownloadIconTask extends DownLoadTask {

	Context _context;
	HttpURLConnection _HttpURLConnection;

	public DownloadIconTask(String url) {
		super(url);
	}

	public void gbkPrevUI() {

	}

	public void download(String URl) throws IOException {
		downloadBitMap(URl);

	}

	public static Bitmap getBigBitmap(String URl)
			throws IOException {
		InputStream inputStream = new FileInputStream(path + getFileName(URl));
		Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
		inputStream.close();
		return bitmap;

	}

	public void cancal() {

		if (_HttpURLConnection != null) {
			_HttpURLConnection.disconnect();
		}

	}

}
